import axiosIntance from "../axiosInstance";

const customInfo = {
    add({custom_name,custom_pwd,custom_sex,custom_tel,custom_email,custom_birthday,custom_address}) {
        axiosIntance.post("/custom-info/add",{
            custom_name,custom_pwd,custom_sex,custom_tel,custom_email,custom_birthday,custom_address
        });
    },
    findAll() {
        return axiosIntance.get("/custom-info/findAll");
    },
    deleteById(id) {
        return axiosIntance.delete(`/custom-info/deleteById/`+id);
    },
    //分页查询用户信息
    //注意get请求的参数与post请求的参数配置是不一样的
    getListByPage({pageIndex,custom_name,custom_tel,custom_email}) {
        return axiosIntance.get("/custom-info/getListByPage",{
            params:{
                pageIndex,custom_name,custom_tel,custom_email
            }
        })
    },
    //更新用户信息
    update({id,custom_name,custom_sex,custom_email,custom_tel,custom_birthday,custom_address}) {
        return axiosIntance.patch("/custom-info/update/"+id,{
            custom_name,custom_sex,custom_email,custom_tel,custom_birthday,custom_address
        });
    }
}

export default customInfo;